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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.u: C = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
e = C("e")
h = D("h")
f = E("f")
l = F("l")
i = C("i")

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.v: C = None
        self.u: C = None
        self.z: D = None
        self.y: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

a = A("a")
d = B("d")
e = C("e")
h = D("h")
f = E("f")
l = F("l")
i = C("i")

a.y = l
a.v = h
d.u = h
d.z = f
e.r = f
e.v = i
e.u = i
e.z = h
e.y = d
h.t = d
h.x = d
f.o = h
l.v = e
l.x = e
l.s = a
i.r = f
i.v = e
i.u = e
i.z = h
i.y = d
assert l.v.u.u.z.x.txt == "d"