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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: E = None
        self.o: B = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.t: D = None
        self.r: A = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: D = None
        self.y: E = None
        self.o: B = None
        self.w: D = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.z: D = None
        self.t: D = None
        self.r: A = None
        self.v: C = None
        self.y: A = None
        self.txt = txt

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

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