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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.p: F = None
        self.y: A = None
        self.v: F = None
        self.w: B = None
        self.txt = txt

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

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

m.s = d
a.x = j
b.y = d
b.u = d
b.x = d
b.w = g
b.q = k
b.z = k
d.u = g
d.p = m
d.w = f
g.u = m
g.y = m
g.x = d
g.p = f
g.v = j
g.w = h
j.z = h
j.w = k
k.y = d
k.u = d
k.x = d
k.w = g
k.q = b
k.z = b
h.x = j
f.z = h
f.w = b
assert m.s.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: D = None
        self.p: F = None
        self.y: A = None
        self.v: F = None
        self.w: B = None
        self.txt = txt

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

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

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