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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

f = A("f")
j = B("j")
b = C("b")
h = D("h")
e = E("e")
i = F("i")
m = A("m")
n = B("n")
c = C("c")
l = E("l")

f.p = b
f.s = h
f.o = i
j.w = f
j.z = i
j.x = i
j.s = m
j.u = c
j.v = h
b.z = j
h.p = f
h.o = f
e.w = n
i.w = h
m.p = b
m.s = h
m.o = i
n.w = m
n.s = m
n.z = i
n.x = i
n.u = b
n.v = h
c.z = n
l.w = n
assert f.o.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: D = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: D = None
        self.txt = txt

f = A("f")
j = B("j")
b = C("b")
h = D("h")
e = E("e")
i = F("i")
m = A("m")
n = B("n")
c = C("c")
l = E("l")

f.p = b
f.s = h
f.o = i
j.w = f
j.z = i
j.x = i
j.s = m
j.u = c
j.v = h
b.z = j
h.p = f
h.o = f
e.w = n
i.w = h
m.p = b
m.s = h
m.o = i
n.w = m
n.s = m
n.z = i
n.x = i
n.u = b
n.v = h
c.z = n
l.w = n
assert f.o.w.p.txt == "f"