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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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