class A:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.s: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.w: E = None
        self.p: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.o: A = None
        self.w: E = None
        self.p: B = None
        self.q: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

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

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

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