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

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.v: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: G = None
        self.v: F = None
        self.q: G = None
        self.t: H = None
        self.p: B = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.w: E = None
        self.s: A = None
        self.txt = txt

f = A("f")
h = B("h")
n = C("n")
b = D("b")
g = E("g")
m = F("m")
a = G("a")
c = H("c")
d = G("d")
k = F("k")

f.q = d
f.y = d
h.w = b
h.s = c
n.t = c
n.o = k
b.q = f
g.y = a
g.u = a
g.v = n
g.w = d
m.x = b
m.o = a
m.v = k
m.q = d
m.t = c
m.y = c
m.p = h
a.w = h
a.x = f
c.o = h
c.v = f
c.s = f
c.w = g
d.w = h
d.x = f
k.x = b
k.o = a
k.v = m
k.q = d
k.t = c
k.y = c
k.p = h
assert g.u.w.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.o: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.u: G = None
        self.v: C = None
        self.w: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.o: G = None
        self.v: F = None
        self.q: G = None
        self.t: H = None
        self.p: B = None
        self.y: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.w: E = None
        self.s: A = None
        self.txt = txt

f = A("f")
h = B("h")
n = C("n")
b = D("b")
g = E("g")
m = F("m")
a = G("a")
c = H("c")
d = G("d")
k = F("k")

f.q = d
f.y = d
h.w = b
h.s = c
n.t = c
n.o = k
b.q = f
g.y = a
g.u = a
g.v = n
g.w = d
m.x = b
m.o = a
m.v = k
m.q = d
m.t = c
m.y = c
m.p = h
a.w = h
a.x = f
c.o = h
c.v = f
c.s = f
c.w = g
d.w = h
d.x = f
k.x = b
k.o = a
k.v = m
k.q = d
k.t = c
k.y = c
k.p = h
assert g.u.w.w.q.txt == "f"