class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: D = None
        self.v: E = None
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.u: A = None
        self.x: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

j = A("j")
n = B("n")
a = C("a")
k = D("k")
c = E("c")
g = F("g")

j.u = c
j.v = c
j.r = c
j.q = k
j.y = a
j.x = g
n.z = k
n.w = k
n.v = j
a.t = j
k.p = a
k.y = a
k.q = g
k.t = c
c.o = a
c.s = j
g.p = k
g.r = k
g.y = n
g.x = n
g.q = n
g.u = j
assert c.s.x.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.q: D = None
        self.v: E = None
        self.y: C = None
        self.x: F = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.q: F = None
        self.t: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: B = None
        self.u: A = None
        self.x: B = None
        self.q: B = None
        self.r: D = None
        self.txt = txt

j = A("j")
n = B("n")
a = C("a")
k = D("k")
c = E("c")
g = F("g")

j.u = c
j.v = c
j.r = c
j.q = k
j.y = a
j.x = g
n.z = k
n.w = k
n.v = j
a.t = j
k.p = a
k.y = a
k.q = g
k.t = c
c.o = a
c.s = j
g.p = k
g.r = k
g.y = n
g.x = n
g.q = n
g.u = j
assert c.s.x.r.y.txt == "a"