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

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

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

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

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

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

b = A("b")
c = B("c")
m = C("m")
l = D("l")
g = E("g")
h = F("h")
e = C("e")
k = D("k")

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

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

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

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

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

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

b = A("b")
c = B("c")
m = C("m")
l = D("l")
g = E("g")
h = F("h")
e = C("e")
k = D("k")

b.w = h
b.y = e
b.x = e
b.z = k
b.p = l
b.t = g
c.z = b
c.r = m
m.y = e
m.q = g
m.x = b
l.q = h
l.v = h
l.x = b
g.p = e
g.u = h
g.z = b
g.v = c
g.o = m
h.v = b
h.x = c
h.u = m
e.y = m
e.q = g
e.x = b
k.q = h
k.v = h
k.x = b
assert k.v.x.r.q.u.txt == "h"