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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.y: F = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: D = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: E = None
        self.y: F = None
        self.x: C = None
        self.s: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: D = None
        self.o: F = None
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.y: A = None
        self.txt = txt

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

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