class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.q: C = None
        self.s: B = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

e = A("e")
c = B("c")
d = C("d")
f = D("f")
j = E("j")
n = F("n")
h = A("h")

e.p = c
e.s = c
e.y = j
e.q = d
e.z = n
e.v = n
c.z = j
c.o = d
d.u = e
f.w = j
f.y = h
f.u = d
f.t = d
j.o = f
n.w = d
n.p = d
h.p = c
h.s = c
h.y = j
h.q = d
h.z = n
h.v = n
assert f.w.o.y.s.z.o.w.txt == "
class A:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: E = None
        self.q: C = None
        self.s: B = None
        self.z: F = None
        self.v: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: A = None
        self.u: C = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: D = None
        self.txt = txt

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

e = A("e")
c = B("c")
d = C("d")
f = D("f")
j = E("j")
n = F("n")
h = A("h")

e.p = c
e.s = c
e.y = j
e.q = d
e.z = n
e.v = n
c.z = j
c.o = d
d.u = e
f.w = j
f.y = h
f.u = d
f.t = d
j.o = f
n.w = d
n.p = d
h.p = c
h.s = c
h.y = j
h.q = d
h.z = n
h.v = n
assert f.w.o.y.s.z.o.w.txt == "j"