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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.t: B = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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