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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.s: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.y: C = None
        self.u: A = None
        self.w: E = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: A = None
        self.s: G = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: F = None
        self.y: C = None
        self.u: A = None
        self.w: E = None
        self.p: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

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

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

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