class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
i = B("i")
j = C("j")
h = D("h")
l = E("l")
k = F("k")
d = B("d")
c = F("c")

a.o = c
a.x = j
a.u = l
i.s = a
i.y = k
i.x = k
i.p = c
i.v = d
i.z = h
j.y = c
j.v = l
h.s = j
h.v = j
h.y = a
l.u = a
l.t = i
l.w = i
k.s = c
k.v = c
k.y = a
d.s = a
d.y = c
d.p = c
d.x = c
d.v = i
d.z = h
c.s = k
c.v = k
c.y = a
assert d.s.u.w.v.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: C = None
        self.u: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.t: B = None
        self.w: B = None
        self.txt = txt

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

a = A("a")
i = B("i")
j = C("j")
h = D("h")
l = E("l")
k = F("k")
d = B("d")
c = F("c")

a.o = c
a.x = j
a.u = l
i.s = a
i.y = k
i.x = k
i.p = c
i.v = d
i.z = h
j.y = c
j.v = l
h.s = j
h.v = j
h.y = a
l.u = a
l.t = i
l.w = i
k.s = c
k.v = c
k.y = a
d.s = a
d.y = c
d.p = c
d.x = c
d.v = i
d.z = h
c.s = k
c.v = k
c.y = a
assert d.s.u.w.v.v.txt == "i"