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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: B = None
        self.r: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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