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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: A = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

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