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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: B = None
        self.txt = txt

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

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

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

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