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

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

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

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

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

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

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

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

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

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

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

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

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

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

j.v = h
j.o = a
f.s = h
f.p = h
h.u = d
e.u = m
m.o = h
m.w = e
m.u = e
m.y = d
m.q = f
a.p = m
d.s = h
d.p = h
assert m.y.p.u.s.u.txt == "d"