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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: G = None
        self.y: E = None
        self.txt = txt

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

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

d.r = c
l.o = e
l.r = h
l.u = j
l.z = j
a.t = e
a.u = k
e.w = a
e.u = a
e.x = h
e.y = h
e.q = b
e.r = l
j.p = e
j.y = e
j.q = k
j.w = k
j.r = d
h.u = g
h.o = c
h.y = j
b.o = e
b.p = e
b.r = k
b.u = c
b.y = a
g.u = h
g.o = b
g.y = j
k.o = e
k.r = h
k.u = j
k.z = j
c.o = e
c.p = e
c.r = l
c.u = b
c.y = a
assert c.o.r.r.u.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: G = None
        self.y: E = None
        self.txt = txt

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

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

d.r = c
l.o = e
l.r = h
l.u = j
l.z = j
a.t = e
a.u = k
e.w = a
e.u = a
e.x = h
e.y = h
e.q = b
e.r = l
j.p = e
j.y = e
j.q = k
j.w = k
j.r = d
h.u = g
h.o = c
h.y = j
b.o = e
b.p = e
b.r = k
b.u = c
b.y = a
g.u = h
g.o = b
g.y = j
k.o = e
k.r = h
k.u = j
k.z = j
c.o = e
c.p = e
c.r = l
c.u = b
c.y = a
assert c.o.r.r.u.u.o.u.txt == "b"