class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: E = None
        self.x: C = None
        self.u: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: E = None
        self.r: A = None
        self.q: B = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.r: C = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: F = None
        self.v: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: D = None
        self.w: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: E = None
        self.r: A = None
        self.q: B = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.z: B = None
        self.r: C = None
        self.t: D = None
        self.y: B = None
        self.txt = txt

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

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