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

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

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

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

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

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

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

d.v = e
d.r = h
d.z = a
g.t = e
e.t = l
e.r = l
e.z = l
e.s = g
e.o = k
l.s = a
a.y = d
k.t = d
f.y = d
h.v = e
h.r = d
h.z = a
assert e.o.t.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: A = None
        self.z: E = None
        self.txt = txt

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

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

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

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

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

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

d.v = e
d.r = h
d.z = a
g.t = e
e.t = l
e.r = l
e.z = l
e.s = g
e.o = k
l.s = a
a.y = d
k.t = d
f.y = d
h.v = e
h.r = d
h.z = a
assert e.o.t.z.y.txt == "d"