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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.w: A = None
        self.s: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.q: F = None
        self.s: C = None
        self.w: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.p: E = None
        self.w: A = None
        self.s: D = None
        self.txt = txt

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

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

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