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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
c = D("c")
a = E("a")
e = F("e")
f = G("f")
i = A("i")
l = F("l")
k = B("k")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

g = A("g")
j = B("j")
m = C("m")
c = D("c")
a = E("a")
e = F("e")
f = G("f")
i = A("i")
l = F("l")
k = B("k")

g.y = j
g.s = c
g.w = c
g.t = c
g.r = a
j.p = a
m.u = k
m.v = k
m.w = a
m.t = c
m.q = j
m.r = f
c.p = g
a.r = f
a.z = f
a.t = l
a.y = e
a.p = m
e.q = i
e.w = f
f.v = c
i.y = k
i.s = c
i.w = c
i.t = c
i.r = a
l.q = i
l.w = f
k.p = a
assert m.t.p.r.p.w.txt == "a"