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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

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

k.t = n
d.o = k
d.q = f
g.v = k
g.t = k
i.o = f
i.t = f
i.u = j
i.x = n
m.t = i
m.x = i
j.x = f
j.v = k
j.y = k
j.q = m
j.r = d
f.o = i
f.t = i
f.u = j
f.x = m
n.t = i
n.x = i
assert k.t.t.o.x.x.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.t: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.x: D = None
        self.txt = txt

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

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

k.t = n
d.o = k
d.q = f
g.v = k
g.t = k
i.o = f
i.t = f
i.u = j
i.x = n
m.t = i
m.x = i
j.x = f
j.v = k
j.y = k
j.q = m
j.r = d
f.o = i
f.t = i
f.u = j
f.x = m
n.t = i
n.x = i
assert k.t.t.o.x.x.t.t.txt == "i"