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

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: F = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.p: F = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

a = A("a")
e = B("e")
m = C("m")
j = D("j")
b = E("b")
i = F("i")
g = F("g")
d = A("d")
h = C("h")
f = C("f")

a.o = m
a.x = e
e.z = a
e.v = g
e.x = g
e.t = d
m.u = j
m.v = b
m.t = e
m.r = e
m.w = h
j.q = b
b.p = a
i.t = b
i.s = b
i.x = b
i.u = b
i.p = g
g.t = b
g.s = b
g.x = b
g.u = b
g.p = i
d.o = h
d.x = e
h.u = j
h.v = b
h.t = e
h.r = e
h.w = f
f.u = j
f.v = b
f.t = e
f.r = e
f.w = m
assert e.x.p.p.u.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: F = None
        self.t: A = None
        self.x: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: E = None
        self.p: F = None
        self.x: E = None
        self.u: E = None
        self.txt = txt

a = A("a")
e = B("e")
m = C("m")
j = D("j")
b = E("b")
i = F("i")
g = F("g")
d = A("d")
h = C("h")
f = C("f")

a.o = m
a.x = e
e.z = a
e.v = g
e.x = g
e.t = d
m.u = j
m.v = b
m.t = e
m.r = e
m.w = h
j.q = b
b.p = a
i.t = b
i.s = b
i.x = b
i.u = b
i.p = g
g.t = b
g.s = b
g.x = b
g.u = b
g.p = i
d.o = h
d.x = e
h.u = j
h.v = b
h.t = e
h.r = e
h.w = f
f.u = j
f.v = b
f.t = e
f.r = e
f.w = m
assert e.x.p.p.u.txt == "b"