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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.s: A = None
        self.x: E = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
j = D("j")
b = E("b")
f = F("f")
a = A("a")

d.z = j
d.o = a
d.v = a
h.o = j
h.s = f
h.z = f
l.x = h
l.s = h
j.x = h
j.v = d
j.s = l
b.r = j
b.u = j
b.q = j
b.t = f
f.r = j
f.t = j
f.z = d
f.s = a
f.x = b
f.y = h
a.z = j
a.o = d
a.v = d
assert a.o.v.o.z.v.v.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.o: A = None
        self.v: A = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: A = None
        self.s: A = None
        self.x: E = None
        self.y: B = None
        self.t: D = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
j = D("j")
b = E("b")
f = F("f")
a = A("a")

d.z = j
d.o = a
d.v = a
h.o = j
h.s = f
h.z = f
l.x = h
l.s = h
j.x = h
j.v = d
j.s = l
b.r = j
b.u = j
b.q = j
b.t = f
f.r = j
f.t = j
f.z = d
f.s = a
f.x = b
f.y = h
a.z = j
a.o = d
a.v = d
assert a.o.v.o.z.v.v.z.txt == "j"