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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.o: B = None
        self.y: G = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.v: B = None
        self.q: E = None
        self.x: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.o: B = None
        self.y: G = None
        self.u: E = None
        self.q: G = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.s: G = None
        self.v: B = None
        self.q: E = None
        self.x: B = None
        self.y: G = None
        self.txt = txt

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

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

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