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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.x: E = None
        self.u: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

d = A("d")
k = B("k")
f = C("f")
i = D("i")
n = E("n")
a = F("a")
g = B("g")

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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.r: E = None
        self.x: E = None
        self.u: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

d = A("d")
k = B("k")
f = C("f")
i = D("i")
n = E("n")
a = F("a")
g = B("g")

d.o = i
k.z = d
k.t = d
k.r = n
k.x = n
k.u = a
f.y = a
f.s = g
f.v = d
i.p = a
i.s = n
i.z = d
n.q = d
n.w = d
n.o = a
n.y = f
a.p = g
a.w = g
a.s = g
a.q = f
a.x = i
a.t = d
g.z = d
g.t = d
g.r = n
g.x = n
g.u = a
assert i.z.o.s.o.txt == "a"