class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.y: C = None
        self.t: B = None
        self.z: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: G = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.w: A = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

b = A("b")
m = B("m")
i = C("i")
n = D("n")
c = E("c")
g = F("g")
l = G("l")
f = F("f")
j = G("j")
d = C("d")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.s: G = None
        self.w: F = None
        self.v: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: A = None
        self.w: A = None
        self.y: B = None
        self.q: B = None
        self.txt = txt

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

b = A("b")
m = B("m")
i = C("i")
n = D("n")
c = E("c")
g = F("g")
l = G("l")
f = F("f")
j = G("j")
d = C("d")

b.o = d
b.y = d
b.t = m
b.z = c
b.x = n
m.t = l
m.s = l
m.w = g
m.v = n
i.z = m
n.y = l
c.s = g
c.t = m
g.x = b
g.p = b
g.w = b
g.y = m
g.q = m
l.w = i
f.x = b
f.p = b
f.w = b
f.y = m
f.q = m
j.w = d
d.z = m
assert d.z.v.y.w.txt == "i"