class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.x: E = None
        self.v: E = None
        self.t: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.p: E = None
        self.t: C = None
        self.q: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: B = None
        self.p: G = None
        self.y: G = None
        self.q: A = None
        self.o: B = None
        self.z: A = None
        self.w: I = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.u: D = None
        self.p: E = None
        self.t: C = None
        self.q: I = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.v: I = None
        self.t: B = None
        self.p: G = None
        self.y: G = None
        self.q: A = None
        self.o: B = None
        self.z: A = None
        self.w: I = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: B = None
        self.u: C = None
        self.r: D = None
        self.txt = txt

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

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

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