class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: B = None
        self.s: C = None
        self.p: B = None
        self.w: H = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
h = C("h")
k = D("k")
b = E("b")
m = F("m")
j = G("j")
i = H("i")

f.y = c
f.x = b
c.u = h
h.v = j
h.w = i
h.q = c
k.x = c
b.r = i
b.w = i
b.y = c
b.p = c
b.s = h
m.y = c
m.x = c
m.w = h
j.x = c
j.r = c
i.u = m
i.r = m
i.q = b
i.v = f
i.o = f
i.p = c
i.x = j
assert h.w.x.r.u.v.r.u.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: H = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: B = None
        self.s: C = None
        self.p: B = None
        self.w: H = None
        self.txt = txt

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

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

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

f = A("f")
c = B("c")
h = C("h")
k = D("k")
b = E("b")
m = F("m")
j = G("j")
i = H("i")

f.y = c
f.x = b
c.u = h
h.v = j
h.w = i
h.q = c
k.x = c
b.r = i
b.w = i
b.y = c
b.p = c
b.s = h
m.y = c
m.x = c
m.w = h
j.x = c
j.r = c
i.u = m
i.r = m
i.q = b
i.v = f
i.o = f
i.p = c
i.x = j
assert h.w.x.r.u.v.r.u.txt == "h"