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

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.t: F = None
        self.y: F = None
        self.s: C = None
        self.txt = txt

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

l = A("l")
g = B("g")
e = C("e")
m = D("m")
j = E("j")
h = F("h")

l.s = g
l.v = g
l.z = g
g.u = j
g.p = l
e.z = j
m.w = g
m.s = g
m.t = l
m.v = l
j.q = l
j.p = h
j.t = h
j.y = h
j.s = e
h.s = e
assert j.s.z.y.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: B = None
        self.z: B = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: F = None
        self.t: F = None
        self.y: F = None
        self.s: C = None
        self.txt = txt

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

l = A("l")
g = B("g")
e = C("e")
m = D("m")
j = E("j")
h = F("h")

l.s = g
l.v = g
l.z = g
g.u = j
g.p = l
e.z = j
m.w = g
m.s = g
m.t = l
m.v = l
j.q = l
j.p = h
j.t = h
j.y = h
j.s = e
h.s = e
assert j.s.z.y.s.txt == "e"