class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.w: G = None
        self.o: H = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.x: D = None
        self.u: C = None
        self.s: G = None
        self.z: F = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: F = None
        self.u: E = None
        self.p: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

f = A("f")
c = B("c")
e = C("e")
n = D("n")
b = E("b")
l = F("l")
m = G("m")
i = H("i")

f.r = l
f.x = i
c.q = l
c.p = f
c.w = m
c.x = m
c.o = i
c.r = i
e.z = f
n.q = b
n.p = f
b.q = e
b.u = e
b.v = l
b.z = l
b.x = n
b.s = m
b.p = f
b.y = i
l.z = c
m.x = f
m.r = l
m.u = b
m.p = n
m.z = e
i.t = l
i.s = c
i.p = m
assert b.q.z.r.z.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: A = None
        self.w: G = None
        self.o: H = None
        self.r: H = None
        self.x: G = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.x: D = None
        self.u: C = None
        self.s: G = None
        self.z: F = None
        self.p: A = None
        self.y: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: F = None
        self.u: E = None
        self.p: D = None
        self.z: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: B = None
        self.p: G = None
        self.txt = txt

f = A("f")
c = B("c")
e = C("e")
n = D("n")
b = E("b")
l = F("l")
m = G("m")
i = H("i")

f.r = l
f.x = i
c.q = l
c.p = f
c.w = m
c.x = m
c.o = i
c.r = i
e.z = f
n.q = b
n.p = f
b.q = e
b.u = e
b.v = l
b.z = l
b.x = n
b.s = m
b.p = f
b.y = i
l.z = c
m.x = f
m.r = l
m.u = b
m.p = n
m.z = e
i.t = l
i.s = c
i.p = m
assert b.q.z.r.z.q.z.txt == "c"