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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: B = None
        self.q: C = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: H = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.p: B = None
        self.q: C = None
        self.x: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: H = None
        self.y: H = None
        self.z: A = None
        self.q: D = None
        self.txt = txt

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

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

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

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