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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.z: G = None
        self.p: B = None
        self.o: G = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

k = A("k")
e = B("e")
g = C("g")
b = D("b")
m = E("m")
n = F("n")
d = G("d")
j = G("j")
a = A("a")
l = B("l")

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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: D = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: F = None
        self.s: F = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: F = None
        self.z: G = None
        self.p: B = None
        self.o: G = None
        self.s: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

k = A("k")
e = B("e")
g = C("g")
b = D("b")
m = E("m")
n = F("n")
d = G("d")
j = G("j")
a = A("a")
l = B("l")

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