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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.p: F = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.o: H = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.v: G = None
        self.u: B = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
g = C("g")
k = D("k")
d = E("d")
a = F("a")
n = G("n")
b = H("b")
l = D("l")

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.p: F = None
        self.s: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.s: E = None
        self.o: H = None
        self.p: G = None
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: C = None
        self.w: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: B = None
        self.v: G = None
        self.u: B = None
        self.txt = txt

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

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

h = A("h")
j = B("j")
g = C("g")
k = D("k")
d = E("d")
a = F("a")
n = G("n")
b = H("b")
l = D("l")

h.q = k
h.u = d
j.r = d
j.v = h
j.p = a
j.s = b
g.z = a
g.s = d
g.o = b
g.p = n
g.u = n
k.r = g
k.w = h
d.u = b
a.z = h
a.t = j
a.u = j
a.v = n
n.o = d
b.u = n
b.s = j
b.y = g
l.r = g
l.w = h
assert h.q.r.p.o.u.s.v.u.u.txt == "b"