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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

c = A("c")
h = B("h")
f = C("f")
g = D("g")
m = E("m")
n = F("n")
j = C("j")
a = A("a")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.p: B = None
        self.q: E = None
        self.txt = txt

c = A("c")
h = B("h")
f = C("f")
g = D("g")
m = E("m")
n = F("n")
j = C("j")
a = A("a")

c.s = n
c.o = n
c.x = f
h.o = n
h.y = m
f.q = m
f.u = m
f.x = j
g.z = n
g.q = n
g.w = a
m.p = j
m.v = h
n.u = a
n.p = h
n.q = m
j.q = m
j.u = m
j.x = f
a.s = n
a.o = n
a.x = j
assert j.x.q.p.x.u.txt == "m"