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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.r: G = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

n = A("n")
k = B("k")
i = C("i")
d = D("d")
h = E("h")
l = F("l")
j = G("j")
e = C("e")

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.y: F = None
        self.z: A = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: B = None
        self.r: G = None
        self.p: D = None
        self.y: E = None
        self.txt = txt

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

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

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

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

n = A("n")
k = B("k")
i = C("i")
d = D("d")
h = E("h")
l = F("l")
j = G("j")
e = C("e")

n.q = k
n.r = k
n.y = h
n.x = e
n.v = j
n.t = l
n.s = l
k.o = n
k.z = n
k.y = l
k.r = l
i.x = n
i.u = k
i.r = j
i.p = d
i.y = h
d.x = n
d.u = j
h.w = n
h.z = n
h.v = d
l.u = k
j.o = e
e.x = n
e.u = k
e.r = j
e.p = d
e.y = h
assert j.o.r.o.u.txt == "k"