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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
n = C("n")
h = D("h")
a = E("a")
l = F("l")
f = G("f")

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

class B:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: D = None
        self.w: A = None
        self.t: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.y: F = None
        self.v: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

m = A("m")
k = B("k")
n = C("n")
h = D("h")
a = E("a")
l = F("l")
f = G("f")

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