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

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

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

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

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

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

k = A("k")
l = B("l")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
f = F("f")
d = C("d")
e = D("e")
g = B("g")

k.x = c
k.z = c
k.y = j
k.r = d
l.v = g
h.w = d
h.t = d
h.x = c
h.o = a
a.z = f
a.v = f
a.y = c
a.r = e
a.s = l
c.q = a
c.z = l
c.s = k
j.s = a
j.v = a
j.y = k
f.s = e
f.v = e
f.y = k
d.w = h
d.t = h
d.x = c
d.o = e
e.z = f
e.v = f
e.y = c
e.r = a
e.s = g
g.v = l
assert f.y.r.o.y.q.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.z: E = None
        self.y: F = None
        self.r: C = None
        self.txt = txt

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

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

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

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

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

k = A("k")
l = B("l")
h = C("h")
a = D("a")
c = E("c")
j = F("j")
f = F("f")
d = C("d")
e = D("e")
g = B("g")

k.x = c
k.z = c
k.y = j
k.r = d
l.v = g
h.w = d
h.t = d
h.x = c
h.o = a
a.z = f
a.v = f
a.y = c
a.r = e
a.s = l
c.q = a
c.z = l
c.s = k
j.s = a
j.v = a
j.y = k
f.s = e
f.v = e
f.y = k
d.w = h
d.t = h
d.x = c
d.o = e
e.z = f
e.v = f
e.y = c
e.r = a
e.s = g
g.v = l
assert f.y.r.o.y.q.z.y.txt == "k"