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

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

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

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

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

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

b = A("b")
n = B("n")
h = C("h")
d = D("d")
a = E("a")
i = F("i")

b.x = a
b.q = h
b.u = n
b.t = n
b.o = i
n.q = h
n.u = i
h.o = a
h.u = d
d.s = n
d.y = h
a.o = b
a.q = b
i.w = a
i.q = n
i.z = n
assert b.x.o.o.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: C = None
        self.u: B = None
        self.t: B = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

b = A("b")
n = B("n")
h = C("h")
d = D("d")
a = E("a")
i = F("i")

b.x = a
b.q = h
b.u = n
b.t = n
b.o = i
n.q = h
n.u = i
h.o = a
h.u = d
d.s = n
d.y = h
a.o = b
a.q = b
i.w = a
i.q = n
i.z = n
assert b.x.o.o.w.q.txt == "b"