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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.o: D = None
        self.z: F = None
        self.x: G = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.p: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.y: A = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.p: F = None
        self.o: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: F = None
        self.o: D = None
        self.z: F = None
        self.x: G = None
        self.u: E = None
        self.w: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: A = None
        self.p: E = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.y: A = None
        self.p: E = None
        self.t: B = None
        self.txt = txt

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

d.r = f
d.y = a
h.v = a
h.p = g
h.o = d
f.v = d
f.p = g
f.z = g
f.w = g
f.o = l
f.x = a
f.u = m
l.p = h
n.t = a
n.z = d
n.p = m
g.x = h
g.w = d
g.p = d
g.o = l
g.z = c
g.q = c
g.t = f
a.w = d
a.y = d
a.z = g
a.p = m
a.t = h
m.t = a
m.z = d
m.p = n
c.v = a
c.p = g
c.o = d
assert d.r.p.q.v.p.t.txt == "a"