class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.x: D = None
        self.t: B = None
        self.z: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.r: C = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.v: E = None
        self.z: F = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
f = D("f")
b = E("b")
n = F("n")

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.o: E = None
        self.r: C = None
        self.q: F = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: F = None
        self.v: E = None
        self.z: F = None
        self.x: E = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.r: A = None
        self.p: B = None
        self.s: D = None
        self.txt = txt

d = A("d")
g = B("g")
j = C("j")
f = D("f")
b = E("b")
n = F("n")

d.p = f
d.x = f
d.t = g
d.z = b
g.x = n
g.q = n
g.o = b
g.r = j
g.p = f
j.o = b
j.v = b
j.x = b
j.r = n
j.z = n
j.p = g
f.z = d
f.x = j
f.y = j
f.w = n
f.o = n
b.s = g
n.v = g
n.p = g
n.r = d
n.s = f
assert j.p.x.r.t.p.z.txt == "d"