class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

d.s = m
m.w = n
b.u = l
b.v = f
a.s = b
a.p = j
n.o = j
n.y = b
c.y = m
l.w = f
f.o = j
f.y = b
j.s = b
j.p = a
assert j.s.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

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

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

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

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

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

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

d.s = m
m.w = n
b.u = l
b.v = f
a.s = b
a.p = j
n.o = j
n.y = b
c.y = m
l.w = f
f.o = j
f.y = b
j.s = b
j.p = a
assert j.s.v.y.txt == "b"