class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.w: F = None
        self.q: E = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.y: D = None
        self.z: B = None
        self.u: D = None
        self.txt = txt

f = A("f")
j = B("j")
e = C("e")
g = D("g")
d = E("d")
c = F("c")
n = E("n")
h = A("h")
l = B("l")

f.o = n
f.x = j
f.w = c
f.p = c
f.q = d
j.t = l
e.v = l
e.y = h
g.y = c
g.z = c
g.s = d
g.o = e
d.s = f
d.p = c
d.z = c
d.w = j
c.p = d
c.x = f
c.y = g
c.u = g
c.z = l
n.s = h
n.p = c
n.z = c
n.w = l
h.o = n
h.x = l
h.w = c
h.p = c
h.q = d
l.t = j
assert h.q.s.w.x.o.s.p.txt == "
class A:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.w: F = None
        self.q: E = None
        self.p: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: F = None
        self.z: F = None
        self.s: E = None
        self.o: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: F = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: E = None
        self.x: A = None
        self.y: D = None
        self.z: B = None
        self.u: D = None
        self.txt = txt

f = A("f")
j = B("j")
e = C("e")
g = D("g")
d = E("d")
c = F("c")
n = E("n")
h = A("h")
l = B("l")

f.o = n
f.x = j
f.w = c
f.p = c
f.q = d
j.t = l
e.v = l
e.y = h
g.y = c
g.z = c
g.s = d
g.o = e
d.s = f
d.p = c
d.z = c
d.w = j
c.p = d
c.x = f
c.y = g
c.u = g
c.z = l
n.s = h
n.p = c
n.z = c
n.w = l
h.o = n
h.x = l
h.w = c
h.p = c
h.q = d
l.t = j
assert h.q.s.w.x.o.s.p.txt == "c"