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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: G = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.r: G = None
        self.y: F = None
        self.v: F = None
        self.txt = txt

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

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

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

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

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

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

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