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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.s: E = None
        self.txt = txt

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

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

d = A("d")
h = B("h")
c = C("c")
b = D("b")
j = E("j")
n = F("n")
a = B("a")
g = E("g")
m = F("m")
i = B("i")

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

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

class C:
    def __init__(self, txt: str):
        self.s: D = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: C = None
        self.s: E = None
        self.txt = txt

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

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

d = A("d")
h = B("h")
c = C("c")
b = D("b")
j = E("j")
n = F("n")
a = B("a")
g = E("g")
m = F("m")
i = B("i")

d.x = c
d.t = c
d.z = h
d.w = j
d.v = b
h.s = d
h.q = c
h.z = j
h.t = b
c.s = b
c.o = n
b.q = d
b.w = c
b.s = j
j.r = g
j.o = a
j.q = b
n.o = m
n.s = m
n.p = i
n.v = d
a.s = d
a.q = c
a.z = g
a.t = b
g.r = j
g.o = a
g.q = b
m.o = n
m.s = n
m.p = i
m.v = d
i.s = d
i.q = c
i.z = g
i.t = b
assert a.s.v.q.txt == "d"