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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: E = None
        self.r: H = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.z: E = None
        self.y: A = None
        self.w: F = None
        self.v: B = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.x: D = None
        self.w: A = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.txt = txt

k = A("k")
c = B("c")
b = C("b")
l = D("l")
g = E("g")
j = F("j")
n = G("n")
e = H("e")

k.q = e
k.r = l
k.s = n
k.u = n
c.t = k
c.y = g
c.w = g
c.u = g
c.r = e
b.u = n
b.x = l
b.z = g
b.y = k
b.o = k
b.w = j
b.r = j
b.v = c
l.x = g
l.y = b
l.u = j
l.z = j
g.t = l
g.x = k
j.r = b
j.y = l
j.x = l
j.w = k
j.z = g
j.q = n
n.r = j
e.q = n
e.r = j
assert k.u.r.r.w.w.q.r.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.r: D = None
        self.s: G = None
        self.u: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.y: E = None
        self.r: H = None
        self.w: E = None
        self.u: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.x: D = None
        self.z: E = None
        self.y: A = None
        self.w: F = None
        self.v: B = None
        self.r: F = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: C = None
        self.u: F = None
        self.z: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: D = None
        self.x: D = None
        self.w: A = None
        self.z: E = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: F = None
        self.txt = txt

k = A("k")
c = B("c")
b = C("b")
l = D("l")
g = E("g")
j = F("j")
n = G("n")
e = H("e")

k.q = e
k.r = l
k.s = n
k.u = n
c.t = k
c.y = g
c.w = g
c.u = g
c.r = e
b.u = n
b.x = l
b.z = g
b.y = k
b.o = k
b.w = j
b.r = j
b.v = c
l.x = g
l.y = b
l.u = j
l.z = j
g.t = l
g.x = k
j.r = b
j.y = l
j.x = l
j.w = k
j.z = g
j.q = n
n.r = j
e.q = n
e.r = j
assert k.u.r.r.w.w.q.r.q.txt == "n"