class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: H = None
        self.p: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: D = None
        self.s: D = None
        self.p: H = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.r: D = None
        self.y: B = None
        self.q: C = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.u: H = None
        self.o: H = None
        self.q: H = None
        self.y: C = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.r: A = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: D = None
        self.s: D = None
        self.p: H = None
        self.o: D = None
        self.y: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: D = None
        self.r: D = None
        self.y: B = None
        self.q: C = None
        self.t: F = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.x: C = None
        self.u: H = None
        self.o: H = None
        self.q: H = None
        self.y: C = None
        self.z: A = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: B = None
        self.t: H = None
        self.r: A = None
        self.txt = txt

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

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

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