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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.z: C = None
        self.t: D = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

j = A("j")
g = B("g")
a = C("a")
e = D("e")
c = E("c")
n = F("n")
b = B("b")

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.o: B = None
        self.z: C = None
        self.t: D = None
        self.x: D = None
        self.q: C = None
        self.txt = txt

j = A("j")
g = B("g")
a = C("a")
e = D("e")
c = E("c")
n = F("n")
b = B("b")

j.y = a
j.w = a
j.x = e
j.q = b
g.q = j
g.s = n
g.t = a
a.w = j
a.s = c
e.s = a
e.x = a
e.z = g
e.p = n
c.q = a
c.w = a
n.v = a
n.z = a
n.q = a
n.o = g
n.t = e
n.x = e
b.q = j
b.s = n
b.t = a
assert g.q.y.s.w.w.y.txt == "a"