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

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

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

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

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

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

h = A("h")
l = B("l")
f = C("f")
n = D("n")
b = E("b")
g = F("g")

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

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

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

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

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

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

h = A("h")
l = B("l")
f = C("f")
n = D("n")
b = E("b")
g = F("g")

h.x = l
h.u = l
h.s = l
h.z = b
h.q = g
l.o = n
f.q = l
f.u = l
f.p = l
f.y = h
f.o = n
n.o = g
b.q = f
b.u = h
b.t = h
b.o = h
b.r = n
g.t = b
g.o = h
g.w = n
g.r = n
g.u = l
assert b.r.o.r.txt == "n"