class A:
    def __init__(self, txt: str):
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: H = None
        self.q: H = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: C = None
        self.w: C = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: H = None
        self.q: H = None
        self.t: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.w: G = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: E = None
        self.w: A = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: C = None
        self.w: C = None
        self.q: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.t: D = None
        self.y: E = None
        self.txt = txt

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

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