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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: D = None
        self.p: E = None
        self.o: G = None
        self.y: D = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: D = None
        self.p: E = None
        self.o: G = None
        self.y: D = None
        self.t: H = None
        self.s: H = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: B = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: B = None
        self.t: B = None
        self.txt = txt

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

i.y = f
i.z = e
h.u = l
h.w = k
h.y = k
h.p = f
h.o = b
h.t = m
h.s = m
j.s = f
k.o = b
k.r = f
k.y = h
f.t = e
f.p = h
e.u = j
e.v = j
l.x = i
l.o = h
l.v = b
l.t = f
m.u = k
m.w = h
m.t = h
b.x = i
b.o = h
b.v = l
b.t = f
assert j.s.p.y.r.txt == "f"