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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.o: F = None
        self.w: A = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.t: F = None
        self.o: F = None
        self.w: A = None
        self.r: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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