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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: B = None
        self.txt = txt

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

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

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