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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: E = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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