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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.q: G = None
        self.x: E = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: C = None
        self.q: G = None
        self.x: E = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

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

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