class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.t: C = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: E = None
        self.t: C = None
        self.p: A = None
        self.z: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.s: G = None
        self.y: F = None
        self.txt = txt

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

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

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

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

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

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

n.r = g
k.y = a
k.v = c
k.z = c
k.t = j
k.p = n
j.o = c
j.s = l
j.y = i
g.y = a
c.u = l
c.x = d
i.p = n
i.o = n
l.v = a
l.r = g
d.o = i
f.p = n
f.o = n
a.r = g
assert i.p.r.y.txt == "a"