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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.x: G = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.p: A = None
        self.q: D = None
        self.t: A = None
        self.r: D = None
        self.w: G = None
        self.txt = txt

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

l = A("l")
b = B("b")
m = C("m")
f = D("f")
d = E("d")
e = F("e")
a = G("a")
g = C("g")
n = E("n")
h = F("h")

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.v: C = None
        self.x: G = None
        self.y: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: D = None
        self.o: B = None
        self.v: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: F = None
        self.o: B = None
        self.p: A = None
        self.q: D = None
        self.t: A = None
        self.r: D = None
        self.w: G = None
        self.txt = txt

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

l = A("l")
b = B("b")
m = C("m")
f = D("f")
d = E("d")
e = F("e")
a = G("a")
g = C("g")
n = E("n")
h = F("h")

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