class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.q: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: A = None
        self.q: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.z: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.s: D = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.u: A = None
        self.q: G = None
        self.r: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: G = None
        self.z: C = None
        self.u: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: C = None
        self.o: F = None
        self.s: D = None
        self.p: E = None
        self.t: D = None
        self.txt = txt

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

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