class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.w: F = None
        self.x: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: D = None
        self.t: F = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: G = None
        self.w: G = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

m = A("m")
d = B("d")
j = C("j")
e = D("e")
n = E("n")
g = F("g")
k = G("k")
l = H("l")
b = B("b")
c = C("c")

m.w = g
m.p = c
d.t = l
j.v = m
j.y = k
j.w = g
j.x = c
e.w = m
n.v = k
n.r = m
g.w = k
g.o = k
k.v = l
k.y = e
k.q = e
k.t = g
k.r = m
l.s = k
l.o = k
l.w = k
l.u = c
l.t = n
b.t = l
c.v = m
c.y = k
c.w = g
c.x = j
assert g.w.r.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: G = None
        self.w: F = None
        self.x: C = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.o: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.y: D = None
        self.t: F = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: G = None
        self.o: G = None
        self.w: G = None
        self.u: C = None
        self.t: E = None
        self.txt = txt

m = A("m")
d = B("d")
j = C("j")
e = D("e")
n = E("n")
g = F("g")
k = G("k")
l = H("l")
b = B("b")
c = C("c")

m.w = g
m.p = c
d.t = l
j.v = m
j.y = k
j.w = g
j.x = c
e.w = m
n.v = k
n.r = m
g.w = k
g.o = k
k.v = l
k.y = e
k.q = e
k.t = g
k.r = m
l.s = k
l.o = k
l.w = k
l.u = c
l.t = n
b.t = l
c.v = m
c.y = k
c.w = g
c.x = j
assert g.w.r.w.txt == "g"