class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.q: F = None
        self.t: D = None
        self.s: G = None
        self.w: G = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: E = None
        self.y: B = None
        self.txt = txt

f = A("f")
n = B("n")
a = C("a")
g = D("g")
m = E("m")
b = F("b")
c = G("c")
k = A("k")
e = E("e")
h = F("h")

f.y = m
f.r = n
n.t = e
a.w = h
a.v = g
a.y = c
g.y = e
m.r = c
b.o = n
b.r = n
b.x = m
b.q = h
b.t = g
b.s = c
b.w = c
c.r = f
c.o = e
c.y = n
k.y = m
k.r = n
e.r = c
h.o = n
h.r = n
h.x = e
h.q = b
h.t = g
h.s = c
h.w = c
assert k.r.t.r.o.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.v: D = None
        self.y: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: E = None
        self.q: F = None
        self.t: D = None
        self.s: G = None
        self.w: G = None
        self.r: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: A = None
        self.o: E = None
        self.y: B = None
        self.txt = txt

f = A("f")
n = B("n")
a = C("a")
g = D("g")
m = E("m")
b = F("b")
c = G("c")
k = A("k")
e = E("e")
h = F("h")

f.y = m
f.r = n
n.t = e
a.w = h
a.v = g
a.y = c
g.y = e
m.r = c
b.o = n
b.r = n
b.x = m
b.q = h
b.t = g
b.s = c
b.w = c
c.r = f
c.o = e
c.y = n
k.y = m
k.r = n
e.r = c
h.o = n
h.r = n
h.x = e
h.q = b
h.t = g
h.s = c
h.w = c
assert k.r.t.r.o.txt == "e"