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

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.r: B = None
        self.y: C = None
        self.w: H = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.q: D = None
        self.x: A = None
        self.u: A = None
        self.txt = txt

e = A("e")
a = B("a")
g = C("g")
l = D("l")
f = E("f")
c = F("c")
k = G("k")
n = H("n")
b = A("b")

e.p = f
e.u = n
a.u = b
a.v = c
g.z = c
l.u = f
l.z = k
f.o = a
f.q = c
f.x = c
c.s = b
c.q = b
c.r = a
c.y = g
c.x = g
c.w = n
c.u = f
k.p = e
k.q = g
k.w = b
k.y = l
n.v = a
n.t = c
n.q = l
n.x = e
n.u = e
b.p = f
b.u = n
assert b.p.q.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: E = None
        self.z: G = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: A = None
        self.r: B = None
        self.y: C = None
        self.w: H = None
        self.u: E = None
        self.x: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: C = None
        self.w: A = None
        self.y: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: B = None
        self.t: F = None
        self.q: D = None
        self.x: A = None
        self.u: A = None
        self.txt = txt

e = A("e")
a = B("a")
g = C("g")
l = D("l")
f = E("f")
c = F("c")
k = G("k")
n = H("n")
b = A("b")

e.p = f
e.u = n
a.u = b
a.v = c
g.z = c
l.u = f
l.z = k
f.o = a
f.q = c
f.x = c
c.s = b
c.q = b
c.r = a
c.y = g
c.x = g
c.w = n
c.u = f
k.p = e
k.q = g
k.w = b
k.y = l
n.v = a
n.t = c
n.q = l
n.x = e
n.u = e
b.p = f
b.u = n
assert b.p.q.u.txt == "f"