class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

d.z = i
d.x = l
d.v = l
k.s = n
k.r = n
k.v = i
n.x = i
n.q = d
j.v = d
j.y = d
j.o = i
f.q = n
f.u = n
f.x = n
f.y = j
f.r = d
f.s = h
f.z = h
f.v = l
h.v = d
i.y = d
i.o = j
l.s = d
l.p = k
assert i.o.o.o.v.x.p.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: H = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: C = None
        self.v: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: A = None
        self.o: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: B = None
        self.txt = txt

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

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