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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.z: H = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: F = None
        self.v: A = None
        self.z: H = None
        self.t: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: E = None
        self.txt = txt

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

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