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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.x: D = None
        self.s: F = None
        self.v: G = None
        self.txt = txt

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

a = A("a")
h = B("h")
l = C("l")
n = D("n")
g = E("g")
b = F("b")
c = G("c")
j = F("j")
f = C("f")

a.t = h
h.v = g
l.o = h
l.s = c
l.y = a
l.z = n
l.t = n
n.x = h
n.y = g
g.r = n
b.p = c
b.v = c
b.w = h
b.x = n
b.s = j
c.r = g
j.p = c
j.v = c
j.w = h
j.x = n
j.s = b
f.o = h
f.s = c
f.y = a
f.z = n
f.t = n
assert h.v.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.x: D = None
        self.s: F = None
        self.v: G = None
        self.txt = txt

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

a = A("a")
h = B("h")
l = C("l")
n = D("n")
g = E("g")
b = F("b")
c = G("c")
j = F("j")
f = C("f")

a.t = h
h.v = g
l.o = h
l.s = c
l.y = a
l.z = n
l.t = n
n.x = h
n.y = g
g.r = n
b.p = c
b.v = c
b.w = h
b.x = n
b.s = j
c.r = g
j.p = c
j.v = c
j.w = h
j.x = n
j.s = b
f.o = h
f.s = c
f.y = a
f.z = n
f.t = n
assert h.v.r.y.txt == "g"