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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.z: H = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.s: E = None
        self.x: C = None
        self.o: E = None
        self.w: G = None
        self.t: C = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.w: C = None
        self.z: H = None
        self.u: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: H = None
        self.z: A = None
        self.o: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: B = None
        self.s: E = None
        self.x: C = None
        self.o: E = None
        self.w: G = None
        self.t: C = None
        self.u: B = None
        self.txt = txt

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

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