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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.q: 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.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: H = None
        self.q: 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.s: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.x: D = None
        self.txt = txt

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

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