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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: I = None
        self.t: H = None
        self.x: A = None
        self.w: E = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.y: I = None
        self.x: G = None
        self.o: A = None
        self.z: A = None
        self.r: A = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.q: I = None
        self.t: H = None
        self.x: A = None
        self.w: E = None
        self.p: D = None
        self.r: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.p: H = None
        self.y: I = None
        self.x: G = None
        self.o: A = None
        self.z: A = None
        self.r: A = None
        self.u: F = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: I = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

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

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