class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: F = None
        self.v: D = None
        self.x: E = None
        self.r: F = None
        self.s: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.t: C = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.q: B = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
l = D("l")
d = E("d")
f = F("f")
g = D("g")
h = B("h")
b = E("b")
e = D("e")

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.o: A = None
        self.t: C = None
        self.s: D = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: F = None
        self.q: B = None
        self.z: B = None
        self.p: B = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

j = A("j")
i = B("i")
m = C("m")
l = D("l")
d = E("d")
f = F("f")
g = D("g")
h = B("h")
b = E("b")
e = D("e")

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