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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: A = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.w: B = None
        self.r: A = None
        self.o: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

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

j.o = d
m.w = h
m.r = j
m.o = e
m.q = e
e.s = k
e.w = m
n.x = k
n.u = k
n.z = d
n.y = d
n.t = j
k.y = j
k.p = f
k.u = f
d.v = e
d.w = f
d.q = f
f.x = k
f.u = k
f.z = d
f.y = d
f.t = j
h.w = m
h.r = j
h.o = e
h.q = e
assert n.x.u.z.txt == "d"