class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.q: D = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.q: E = None
        self.t: A = None
        self.o: A = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.q: A = None
        self.y: A = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.u: C = None
        self.t: D = None
        self.o: C = None
        self.s: C = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

b = A("b")
n = B("n")
f = C("f")
c = D("c")
j = E("j")
h = F("h")
m = G("m")
i = H("i")

b.p = h
b.s = f
b.q = c
b.y = i
b.u = n
n.q = m
f.p = b
f.t = b
f.o = b
f.z = j
f.q = j
f.r = c
f.x = h
c.r = h
c.x = j
c.q = b
c.y = b
c.p = i
c.o = i
j.x = i
h.o = c
h.y = n
m.x = f
m.u = f
m.o = f
m.s = f
m.q = b
m.t = c
m.w = h
m.p = j
i.s = b
i.v = c
assert h.o.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: C = None
        self.q: D = None
        self.y: H = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: E = None
        self.q: E = None
        self.t: A = None
        self.o: A = None
        self.r: D = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.x: E = None
        self.q: A = None
        self.y: A = None
        self.p: H = None
        self.o: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.u: C = None
        self.t: D = None
        self.o: C = None
        self.s: C = None
        self.w: F = None
        self.p: E = None
        self.txt = txt

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

b = A("b")
n = B("n")
f = C("f")
c = D("c")
j = E("j")
h = F("h")
m = G("m")
i = H("i")

b.p = h
b.s = f
b.q = c
b.y = i
b.u = n
n.q = m
f.p = b
f.t = b
f.o = b
f.z = j
f.q = j
f.r = c
f.x = h
c.r = h
c.x = j
c.q = b
c.y = b
c.p = i
c.o = i
j.x = i
h.o = c
h.y = n
m.x = f
m.u = f
m.o = f
m.s = f
m.q = b
m.t = c
m.w = h
m.p = j
i.s = b
i.v = c
assert h.o.p.s.txt == "b"