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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: C = None
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: D = None
        self.x: C = None
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

h.z = f
h.r = n
h.q = n
h.v = i
i.r = m
i.v = j
i.q = l
i.z = g
g.t = i
g.q = i
g.w = i
g.r = f
g.y = m
l.z = f
l.x = f
n.q = h
n.t = h
n.s = i
n.y = m
n.v = l
n.x = l
j.o = l
j.x = g
j.v = k
j.y = k
m.z = l
m.r = n
m.q = n
m.v = i
k.o = l
k.x = g
k.v = j
k.y = j
f.z = l
f.x = l
assert l.x.x.x.z.x.x.x.z.z.txt == "f"