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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: B = None
        self.r: E = None
        self.w: G = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: C = None
        self.s: B = None
        self.r: E = None
        self.w: G = None
        self.y: G = None
        self.z: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.q: D = None
        self.txt = txt

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

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