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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: A = None
        self.x: F = None
        self.r: E = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: F = None
        self.v: H = None
        self.y: G = None
        self.r: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.v: B = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.z: A = None
        self.x: F = None
        self.r: E = None
        self.t: D = None
        self.y: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: F = None
        self.v: H = None
        self.y: G = None
        self.r: E = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: H = None
        self.v: B = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.p: H = None
        self.w: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: B = None
        self.y: C = None
        self.txt = txt

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

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