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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: C = None
        self.u: D = None
        self.r: B = None
        self.txt = txt

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

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

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

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