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

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

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

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

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

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

c = A("c")
a = B("a")
g = C("g")
e = D("e")
l = E("l")
f = F("f")
i = D("i")
m = D("m")

c.z = m
c.q = g
c.t = f
a.u = e
a.z = f
a.o = c
g.q = a
g.v = a
g.y = l
g.z = l
g.o = c
e.w = c
l.u = f
l.x = c
l.r = i
f.p = g
f.w = a
f.q = a
i.w = c
m.w = c
assert l.x.z.w.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: C = None
        self.t: F = None
        self.txt = txt

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

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

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

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

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

c = A("c")
a = B("a")
g = C("g")
e = D("e")
l = E("l")
f = F("f")
i = D("i")
m = D("m")

c.z = m
c.q = g
c.t = f
a.u = e
a.z = f
a.o = c
g.q = a
g.v = a
g.y = l
g.z = l
g.o = c
e.w = c
l.u = f
l.x = c
l.r = i
f.p = g
f.w = a
f.q = a
i.w = c
m.w = c
assert l.x.z.w.txt == "c"