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

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

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

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

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

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

h = A("h")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
k = C("k")
f = D("f")

h.x = e
h.u = e
h.z = j
h.p = n
h.q = b
h.v = f
e.u = h
e.r = h
e.p = i
e.z = f
e.q = f
n.q = f
n.w = b
n.v = k
n.r = i
b.t = i
b.q = e
i.t = e
i.q = f
j.p = k
j.u = b
k.q = f
k.w = b
k.v = n
k.r = i
f.t = i
f.q = e
assert b.t.q.q.p.q.t.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: F = None
        self.p: C = None
        self.q: D = None
        self.u: B = None
        self.v: D = None
        self.txt = txt

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

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

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

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

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

h = A("h")
e = B("e")
n = C("n")
b = D("b")
i = E("i")
j = F("j")
k = C("k")
f = D("f")

h.x = e
h.u = e
h.z = j
h.p = n
h.q = b
h.v = f
e.u = h
e.r = h
e.p = i
e.z = f
e.q = f
n.q = f
n.w = b
n.v = k
n.r = i
b.t = i
b.q = e
i.t = e
i.q = f
j.p = k
j.u = b
k.q = f
k.w = b
k.v = n
k.r = i
f.t = i
f.q = e
assert b.t.q.q.p.q.t.t.q.txt == "f"