class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

h = A("h")
a = B("a")
g = C("g")
l = D("l")
m = E("m")
f = F("f")
i = C("i")

h.v = i
h.s = i
h.w = l
h.y = l
a.r = h
g.u = m
l.s = h
m.q = h
m.t = l
f.u = i
i.u = m
assert m.q.v.u.q.s.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.y: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.t: D = None
        self.txt = txt

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

h = A("h")
a = B("a")
g = C("g")
l = D("l")
m = E("m")
f = F("f")
i = C("i")

h.v = i
h.s = i
h.w = l
h.y = l
a.r = h
g.u = m
l.s = h
m.q = h
m.t = l
f.u = i
i.u = m
assert m.q.v.u.q.s.u.t.txt == "l"