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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.o: D = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: B = None
        self.s: D = None
        self.o: D = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

j = A("j")
g = B("g")
h = C("h")
d = D("d")
a = E("a")
c = F("c")

j.w = c
j.y = c
j.p = c
j.q = h
j.x = h
j.s = d
g.y = c
g.z = a
h.w = d
h.o = d
h.z = g
h.v = g
h.s = a
d.s = a
d.x = c
d.w = c
a.p = c
a.y = g
a.s = d
a.o = d
a.t = d
a.u = j
c.w = a
c.s = g
assert c.s.z.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.q: C = None
        self.s: D = None
        self.x: C = None
        self.y: F = None
        self.p: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.z: B = None
        self.o: D = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.w: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: B = None
        self.s: D = None
        self.o: D = None
        self.t: D = None
        self.u: A = None
        self.txt = txt

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

j = A("j")
g = B("g")
h = C("h")
d = D("d")
a = E("a")
c = F("c")

j.w = c
j.y = c
j.p = c
j.q = h
j.x = h
j.s = d
g.y = c
g.z = a
h.w = d
h.o = d
h.z = g
h.v = g
h.s = a
d.s = a
d.x = c
d.w = c
a.p = c
a.y = g
a.s = d
a.o = d
a.t = d
a.u = j
c.w = a
c.s = g
assert c.s.z.p.s.txt == "g"