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

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: A = None
        self.r: B = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

f.x = j
f.p = k
h.y = f
m.x = b
m.p = b
m.v = f
m.r = i
m.o = i
k.r = g
k.q = i
k.x = f
j.x = n
j.p = n
j.t = k
j.o = f
b.y = k
b.x = n
b.z = f
g.y = f
a.y = f
i.y = f
n.x = j
n.p = j
n.t = k
n.o = f
assert g.y.x.t.q.y.x.x.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.x: F = None
        self.v: A = None
        self.r: B = None
        self.o: B = None
        self.p: F = None
        self.txt = txt

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

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

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

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

f.x = j
f.p = k
h.y = f
m.x = b
m.p = b
m.v = f
m.r = i
m.o = i
k.r = g
k.q = i
k.x = f
j.x = n
j.p = n
j.t = k
j.o = f
b.y = k
b.x = n
b.z = f
g.y = f
a.y = f
i.y = f
n.x = j
n.p = j
n.t = k
n.o = f
assert g.y.x.t.q.y.x.x.o.p.txt == "k"