class A:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.y: C = None
        self.t: H = None
        self.x: C = None
        self.u: H = None
        self.z: F = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.o: B = None
        self.y: C = None
        self.t: H = None
        self.x: C = None
        self.u: H = None
        self.z: F = None
        self.txt = txt

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

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

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