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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

n = A("n")
j = B("j")
k = C("k")
e = D("e")
f = E("f")
l = F("l")
h = G("h")
c = D("c")
a = F("a")
m = F("m")

n.s = c
j.w = c
j.z = n
k.w = c
k.r = j
k.v = f
k.u = n
e.v = h
f.v = c
l.v = n
l.p = n
l.o = c
h.y = n
c.v = h
a.v = n
a.p = n
a.o = e
m.v = n
m.p = n
m.o = c
assert e.v.y.s.v.y.s.v.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: A = None
        self.txt = txt

n = A("n")
j = B("j")
k = C("k")
e = D("e")
f = E("f")
l = F("l")
h = G("h")
c = D("c")
a = F("a")
m = F("m")

n.s = c
j.w = c
j.z = n
k.w = c
k.r = j
k.v = f
k.u = n
e.v = h
f.v = c
l.v = n
l.p = n
l.o = c
h.y = n
c.v = h
a.v = n
a.p = n
a.o = e
m.v = n
m.p = n
m.o = c
assert e.v.y.s.v.y.s.v.txt == "h"