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

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.t: D = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
n = C("n")
e = D("e")
c = E("c")
b = A("b")
h = E("h")
k = B("k")
g = C("g")

i.r = n
i.x = n
i.v = n
i.t = b
f.u = e
f.y = h
f.r = i
f.p = k
n.x = h
n.r = h
n.q = e
n.t = e
n.p = k
e.w = b
e.z = h
e.q = c
e.x = f
e.p = i
c.v = i
c.t = i
c.o = i
b.r = n
b.x = n
b.v = n
b.t = i
h.v = b
h.t = b
h.o = i
k.u = e
k.y = c
k.r = i
k.p = f
g.x = c
g.q = e
g.t = e
g.p = k
g.r = h
assert g.t.q.v.t.t.x.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: A = None
        self.x: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: D = None
        self.y: E = None
        self.r: A = None
        self.p: B = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.t: D = None
        self.p: B = None
        self.r: E = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
n = C("n")
e = D("e")
c = E("c")
b = A("b")
h = E("h")
k = B("k")
g = C("g")

i.r = n
i.x = n
i.v = n
i.t = b
f.u = e
f.y = h
f.r = i
f.p = k
n.x = h
n.r = h
n.q = e
n.t = e
n.p = k
e.w = b
e.z = h
e.q = c
e.x = f
e.p = i
c.v = i
c.t = i
c.o = i
b.r = n
b.x = n
b.v = n
b.t = i
h.v = b
h.t = b
h.o = i
k.u = e
k.y = c
k.r = i
k.p = f
g.x = c
g.q = e
g.t = e
g.p = k
g.r = h
assert g.t.q.v.t.t.x.x.v.txt == "b"