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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: H = None
        self.t: C = None
        self.u: E = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: B = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: F = None
        self.r: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: H = None
        self.t: C = None
        self.u: E = None
        self.o: H = None
        self.q: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.p: B = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

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

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