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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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