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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.z: E = None
        self.r: C = None
        self.v: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: A = None
        self.p: D = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: F = None
        self.z: E = None
        self.r: C = None
        self.v: C = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.q: A = None
        self.p: D = None
        self.w: D = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: D = None
        self.p: E = None
        self.w: A = None
        self.txt = txt

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

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

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