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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

e.x = c
e.y = a
c.s = b
n.v = b
n.u = c
n.p = a
a.y = f
a.s = n
a.u = n
a.t = c
b.x = c
b.y = k
g.x = c
g.y = f
k.y = f
k.s = n
k.u = n
k.t = c
f.y = a
f.s = n
f.u = n
f.t = c
h.x = c
h.y = f
assert f.s.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: B = None
        self.y: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.txt = txt

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

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

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

e.x = c
e.y = a
c.s = b
n.v = b
n.u = c
n.p = a
a.y = f
a.s = n
a.u = n
a.t = c
b.x = c
b.y = k
g.x = c
g.y = f
k.y = f
k.s = n
k.u = n
k.t = c
f.y = a
f.s = n
f.u = n
f.t = c
h.x = c
h.y = f
assert f.s.v.y.txt == "k"