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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.u: G = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.o: A = None
        self.u: G = None
        self.w: B = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: C = None
        self.txt = txt

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

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