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

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

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

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

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

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

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

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

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

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

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

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

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

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

d.o = h
d.y = j
d.p = i
b.p = i
b.v = i
b.x = h
b.s = h
b.r = n
b.o = d
n.v = h
n.u = h
n.s = h
n.q = j
n.z = k
n.p = k
j.p = i
j.v = k
j.r = d
h.w = j
h.x = d
h.t = d
i.q = n
i.t = n
i.o = k
i.z = d
i.r = d
i.u = j
k.p = i
k.v = i
k.x = h
k.s = h
k.r = n
k.o = d
assert k.o.y.r.o.t.o.x.txt == "d"