class A:
    def __init__(self, txt: str):
        self.y: G = None
        self.t: I = None
        self.p: I = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: B = None
        self.v: I = None
        self.p: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: B = None
        self.v: I = None
        self.p: G = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.s: B = None
        self.u: C = None
        self.txt = txt

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

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

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