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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: E = None
        self.z: F = None
        self.v: E = None
        self.u: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.z: D = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: F = None
        self.r: D = None
        self.txt = txt

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

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