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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: B = None
        self.t: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.w: D = None
        self.txt = txt

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

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

g.v = h
c.x = k
a.y = e
a.s = e
a.t = d
k.y = a
k.w = b
h.p = b
h.r = f
h.y = f
h.x = a
h.q = k
d.y = c
d.s = e
d.t = a
e.x = k
f.p = k
f.q = k
f.r = h
f.y = h
f.x = a
b.y = d
b.w = k
assert f.x.s.x.y.y.txt == "e"