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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.u: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
j = B("j")
l = C("l")
g = D("g")
h = E("h")
e = F("e")

b.x = l
b.t = l
b.r = j
b.q = j
b.p = h
j.o = h
j.u = h
j.t = g
j.r = l
l.w = b
l.u = g
l.v = g
l.o = j
l.s = h
g.q = b
g.u = b
g.x = j
g.o = j
g.s = h
h.q = e
h.z = b
e.z = j
assert j.u.q.z.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: B = None
        self.p: E = None
        self.t: C = None
        self.q: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.t: D = None
        self.u: E = None
        self.r: C = None
        self.txt = txt

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

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

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

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

b = A("b")
j = B("j")
l = C("l")
g = D("g")
h = E("h")
e = F("e")

b.x = l
b.t = l
b.r = j
b.q = j
b.p = h
j.o = h
j.u = h
j.t = g
j.r = l
l.w = b
l.u = g
l.v = g
l.o = j
l.s = h
g.q = b
g.u = b
g.x = j
g.o = j
g.s = h
h.q = e
h.z = b
e.z = j
assert j.u.q.z.t.u.txt == "b"