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

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

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

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

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

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

k.t = c
k.w = c
k.r = f
c.x = m
g.x = k
g.w = f
g.q = c
g.r = a
j.s = e
j.x = m
j.z = c
n.v = m
e.r = n
e.o = n
e.w = c
e.u = c
m.s = g
a.r = n
a.o = n
a.w = c
a.u = c
f.x = k
f.w = g
f.q = c
f.r = e
h.s = e
h.x = m
h.z = c
assert e.u.x.s.w.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.w: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: G = None
        self.z: B = None
        self.txt = txt

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

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

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

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

k.t = c
k.w = c
k.r = f
c.x = m
g.x = k
g.w = f
g.q = c
g.r = a
j.s = e
j.x = m
j.z = c
n.v = m
e.r = n
e.o = n
e.w = c
e.u = c
m.s = g
a.r = n
a.o = n
a.w = c
a.u = c
f.x = k
f.w = g
f.q = c
f.r = e
h.s = e
h.x = m
h.z = c
assert e.u.x.s.w.q.x.txt == "m"