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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = 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: E = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.p: D = None
        self.y: A = None
        self.txt = txt

c = A("c")
f = B("f")
j = C("j")
d = D("d")
n = E("n")
e = F("e")
a = F("a")
h = D("h")
l = E("l")

c.s = a
c.x = j
f.p = c
f.v = c
f.q = j
f.z = l
f.x = n
j.r = c
j.w = f
d.z = c
n.p = l
n.o = c
n.u = j
e.s = h
e.p = h
e.u = l
e.y = c
a.s = d
a.u = n
a.p = h
a.y = c
h.z = c
l.p = n
l.o = c
l.u = j
assert e.p.z.x.r.x.w.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: F = None
        self.x: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = 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: E = None
        self.o: A = None
        self.u: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.u: E = None
        self.p: D = None
        self.y: A = None
        self.txt = txt

c = A("c")
f = B("f")
j = C("j")
d = D("d")
n = E("n")
e = F("e")
a = F("a")
h = D("h")
l = E("l")

c.s = a
c.x = j
f.p = c
f.v = c
f.q = j
f.z = l
f.x = n
j.r = c
j.w = f
d.z = c
n.p = l
n.o = c
n.u = j
e.s = h
e.p = h
e.u = l
e.y = c
a.s = d
a.u = n
a.p = h
a.y = c
h.z = c
l.p = n
l.o = c
l.u = j
assert e.p.z.x.r.x.w.p.txt == "c"