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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

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

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

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

c.r = l
j.y = m
j.q = c
m.y = d
d.s = f
d.z = f
d.y = l
d.q = m
d.x = m
d.u = g
h.z = j
h.u = c
h.o = m
e.q = c
a.r = c
a.y = c
a.v = h
a.w = g
a.q = g
a.s = d
a.x = l
g.q = c
l.r = c
l.y = c
l.v = h
l.w = e
l.s = d
l.x = a
l.q = g
f.s = d
f.z = d
f.y = a
f.q = m
f.x = m
f.u = e
assert e.q.r.v.u.r.x.v.txt == "h"