class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.o: G = None
        self.x: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

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

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

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

k.x = l
l.p = f
l.z = i
l.v = e
h.u = l
h.z = m
e.w = i
e.s = l
e.o = m
e.u = m
e.x = n
n.o = i
n.p = i
n.w = m
i.r = k
m.u = i
m.t = e
f.w = i
f.s = l
f.o = m
f.u = m
f.x = n
d.u = l
d.z = m
assert k.x.z.r.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: F = None
        self.v: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: B = None
        self.o: G = None
        self.x: E = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: F = None
        self.p: F = None
        self.w: G = None
        self.txt = txt

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

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

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

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