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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.y: B = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.o: B = None
        self.p: C = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

n = A("n")
m = B("m")
g = C("g")
d = D("d")
c = E("c")
j = F("j")

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

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

class C:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: D = None
        self.s: F = None
        self.o: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: C = None
        self.y: B = None
        self.w: D = None
        self.r: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: D = None
        self.o: B = None
        self.p: C = None
        self.s: A = None
        self.r: A = None
        self.txt = txt

n = A("n")
m = B("m")
g = C("g")
d = D("d")
c = E("c")
j = F("j")

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