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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.w: F = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
d = D("d")
l = E("l")
i = F("i")
g = F("g")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: B = None
        self.z: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.x: B = None
        self.w: F = None
        self.t: F = None
        self.u: C = None
        self.txt = txt

c = A("c")
e = B("e")
n = C("n")
d = D("d")
l = E("l")
i = F("i")
g = F("g")

c.t = l
c.q = n
e.v = d
e.q = d
e.z = g
e.y = c
e.x = c
e.p = c
n.x = l
n.z = l
d.z = n
l.x = n
l.s = e
l.z = d
i.r = d
i.x = e
i.w = g
i.t = g
i.u = n
g.r = d
g.x = e
g.w = i
g.t = i
g.u = n
assert g.x.x.t.z.z.txt == "n"