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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.p: D = None
        self.s: C = None
        self.z: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.txt = txt

c = A("c")
d = B("d")
j = C("j")
k = D("k")
b = E("b")
a = F("a")
i = G("i")
e = A("e")

c.v = d
c.x = d
c.w = j
c.t = a
d.u = j
d.s = j
d.v = k
d.p = k
d.z = k
j.r = k
j.u = b
j.p = b
k.o = c
b.y = k
b.x = k
b.v = a
b.o = a
b.p = c
a.w = d
a.q = i
i.v = k
i.o = k
e.v = d
e.x = d
e.w = j
e.t = a
assert i.v.o.w.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.w: C = None
        self.t: F = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.v: D = None
        self.p: D = None
        self.s: C = None
        self.z: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: B = None
        self.q: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.o: D = None
        self.txt = txt

c = A("c")
d = B("d")
j = C("j")
k = D("k")
b = E("b")
a = F("a")
i = G("i")
e = A("e")

c.v = d
c.x = d
c.w = j
c.t = a
d.u = j
d.s = j
d.v = k
d.p = k
d.z = k
j.r = k
j.u = b
j.p = b
k.o = c
b.y = k
b.x = k
b.v = a
b.o = a
b.p = c
a.w = d
a.q = i
i.v = k
i.o = k
e.v = d
e.x = d
e.w = j
e.t = a
assert i.v.o.w.p.v.txt == "a"