class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.x: F = None
        self.p: C = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.x: F = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

a.r = f
a.q = i
a.x = c
a.p = d
a.s = d
a.z = d
f.o = i
f.s = i
f.u = m
f.r = e
f.x = d
f.w = b
d.y = l
d.o = a
i.v = l
i.w = m
l.t = g
l.q = b
b.w = d
b.t = e
e.o = l
e.u = a
e.x = c
e.s = b
e.q = d
c.w = d
c.t = e
m.v = l
m.w = i
g.o = m
g.s = i
g.u = i
g.r = e
g.x = d
g.w = c
assert i.w.w.v.q.w.y.q.t.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.q: D = None
        self.x: F = None
        self.p: C = None
        self.s: C = None
        self.z: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: A = None
        self.x: F = None
        self.s: F = None
        self.q: C = None
        self.txt = txt

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

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