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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.q: C = None
        self.u: A = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.z: C = None
        self.q: C = None
        self.u: A = None
        self.r: D = None
        self.txt = txt

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

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

g.s = e
g.u = e
g.w = j
e.v = f
j.y = l
j.x = f
l.t = g
l.v = f
l.w = e
m.x = j
m.z = j
m.q = j
m.u = g
m.r = l
f.u = l
assert g.u.v.u.t.u.txt == "e"