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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: G = None
        self.w: D = None
        self.t: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.s: B = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

b = A("b")
a = B("a")
i = C("i")
c = D("c")
m = E("m")
e = F("e")
d = G("d")
n = D("n")
j = E("j")

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.s: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: G = None
        self.w: D = None
        self.t: G = None
        self.s: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: G = None
        self.q: G = None
        self.s: B = None
        self.r: E = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.t: C = None
        self.s: A = None
        self.z: D = None
        self.txt = txt

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

b = A("b")
a = B("a")
i = C("i")
c = D("c")
m = E("m")
e = F("e")
d = G("d")
n = D("n")
j = E("j")

b.r = j
b.u = c
b.o = i
a.t = i
a.s = d
a.z = b
i.t = b
i.s = a
c.r = a
c.x = d
c.t = d
c.w = n
c.s = e
m.o = d
m.q = d
m.s = a
m.r = j
m.y = b
e.w = d
e.t = i
e.s = b
e.z = n
d.o = b
d.w = a
d.t = i
n.r = a
n.x = d
n.t = d
n.w = c
n.s = e
j.o = d
j.q = d
j.s = a
j.r = m
j.y = b
assert a.z.r.y.r.q.t.s.z.txt == "b"