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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.v: G = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: A = None
        self.z: A = None
        self.t: A = None
        self.p: G = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.t: A = None
        self.v: G = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: A = None
        self.z: A = None
        self.t: A = None
        self.p: G = None
        self.txt = txt

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

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

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