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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: A = None
        self.w: B = None
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.txt = txt

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

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