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

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

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

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

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

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

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

b.x = l
b.w = k
k.u = f
k.v = a
f.s = d
f.p = d
c.z = b
d.p = f
d.o = c
l.v = k
l.r = i
l.o = i
i.p = f
i.o = c
a.v = k
a.r = i
a.o = i
assert f.s.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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

b.x = l
b.w = k
k.u = f
k.v = a
f.s = d
f.p = d
c.z = b
d.p = f
d.o = c
l.v = k
l.r = i
l.o = i
i.p = f
i.o = c
a.v = k
a.r = i
a.o = i
assert f.s.p.p.txt == "d"