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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: E = None
        self.r: A = None
        self.q: E = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.u: C = None
        self.txt = txt

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

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